{include file="public/head"/}
{include file="public/left"/}
<div class="main-content">
<div class="main-content-inner">
{include file="public/nav_head"/}
<form class="form-horizontal" role="form" method="post" id="form" action="{:url('nav/editHandle')}">
    <input type="hidden" name="id" value="{$arc.id}">
    <div class="row" style="margin:15px 0 0 0">
        <div class="col-xs-12 col-sm-12 col-md-9" id="myleft">
            <div class="panel panel-default">
                <div class="panel-heading">基本信息</div>
                <div class="panel-body" style="position:relative">
                    
                    <div class="form-group">
                        <label class="col-sm-1 control-label no-padding-right"> 频道模型 </label>
                        <div class="col-sm-5">
                            <select class="form-control" id="cid" name="cid">
                                <option value="0">请选择栏目模型</option>
                                {foreach name="cals" item="oc"}
                                {if condition="$oc['status'] EQ 1"}
                                <option value="{$oc.id}" {if condition="$oc['id'] EQ $navself['cid']"}selected{/if} tpl="{$oc.table}">{$oc.name}
                                </option>
                                {/if}
                                {/foreach}
                            </select>
                        </div>
                        <label class="col-sm-1 control-label no-padding-right"> 所属栏目 </label>
                        <div class="col-sm-5">
                            <select class="form-control" id="pid" name="pid">
                                <option value="0">顶级栏目</option>
                                {volist name="navlevel" id="nav"}
                                <option value="{$nav.id}" {if condition="$nav['id'] EQ $arc['pid']"}selected{/if}>
                                    {if condition="$nav['level'] EQ 0"}{$nav.navname}{/if}
                                    {if condition="$nav['level'] EQ 1"}　{$nav.navname}{/if}
                                    {if condition="$nav['level'] EQ 2"}　　{$nav.navname}{/if}
                                    {if condition="$nav['level'] EQ 3"}　　　{$nav.navname}{/if}
                                </option>
                                {/volist}
                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-1 control-label no-padding-right"> 栏目标题 </label>
                        <div class="col-sm-5">
                            <input type="text" name="navname" id="navname" value="{$arc.navname}" class="col-xs-12 col-sm-12"/>
                        </div>
                        <label class="col-sm-1 control-label no-padding-right"> 英文标题 </label>
                        <div class="col-sm-5">
                            <input type="text" name="ename" class="col-xs-12 col-sm-12" value="{$arc.ename}" />
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-sm-1 control-label no-padding-right"> 栏目图标 </label>
                        <div class="col-sm-5">
                            <input type="text" name="litpic"  value="{$arc.litpic}" class="col-xs-10 col-sm-10"/>
                            <a class="upbutton btn btn-primary" id="litpic_btn">选择</a>
                        </div>
                        <label class="col-sm-1 control-label no-padding-right"> 跳转地址 </label>
                        <div class="col-sm-5">
                            <input type="text" name="jump" class="col-xs-12 col-sm-12" value="{$arc.jump}" placeholder="" />
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-sm-1 control-label no-padding-right"> SEO标题 </label>
                        <div class="col-sm-11">
                            <input type="text" name="seotitle" class="col-xs-12 col-sm-12" value="{$arc.seotitle}"/>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-sm-1 control-label no-padding-right"> 关 &nbsp;键 &nbsp;字 </label>
                        <div class="col-sm-11">
                            <input type="text" name="keywords" class="col-xs-12 col-sm-12" value="{$arc.keywords}"/>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-sm-1 control-label no-padding-right"> 内容摘要 </label>
                        <div class="col-sm-11">
                            <textarea name="description" rows="3" class="col-xs-12 col-sm-12">{$arc.description}</textarea>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-sm-1 control-label no-padding-right"> 栏目内容 </label>
                        <div class="col-sm-11">
                        <textarea name="content" id="body" class="col-xs-12 col-sm-12 pdno">{$arc.content}</textarea>
                        <script>var ue = UE.getEditor('body');</script>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-xs-12 col-sm-12 col-md-3" >
            <div class="panel panel-default" id="myright" style="position:relative">
                <div class="panel-heading">其他选项</div>
                <div class="panel-body"  >
                    <div class="form-group">
                        <label class="col-sm-12 no-padding-right"> 列表模板 </label>
                        <div class="col-sm-12 mb15">
                            <select class="form-control" id="tpl" name="tpl">
                                <option value="0">系统自动选择,特殊样式手动选择</option>
                                {foreach name="listtpl" item="t"}
                                <option value="{$t}" {if condition="$t EQ $arc['tpl']"}selected{/if}>{$t}</option>
                                {/foreach}
                            </select>
                        </div>
                        {if condition="$cfg['open_member'] EQ 'y'"}
                        <label class="col-sm-12 no-padding-right"> 浏览权限 </label>
                        <div class="col-sm-12">
                            <select class="form-control" id="mgroupid" name="mgroupid">
                                {foreach name="authlist" item="a"}
                                <option value="{$a.gid}" {if condition="$arc['mgroupid'] EQ $a['gid']"}selected{/if}>{$a.gname}</option>
                                {/foreach}
                            </select>
                        </div>
                        {/if}
                    </div>
                </div>
                <div class="panel-footer text-center">
                    <button class="ky_btn btn_blue" type="submit" style="padding:10px 25px">
                        <i class="ace-icon fa fa-check bigger-110"></i>保存
                    </button>
                </div>
            </div>
        </div>
    </div>
</form>
</div>
</div>

{include file="public/foot"/}
<script type="text/javascript">
     $('#form').ajaxForm({
        success : complete,
        dataType : 'json'
    });
  
    function complete(data){
        if(data.status==0){
            layer.msg(data.msg,{icon:5});
        }
        if(data.status==1){
            layer.msg(data.msg,{icon:6},function(){
                window.location.href=data.url;
            });
        }
    }

$(function(){
    
    var leftheight = $('#myleft').height();
    $('#myright .panel-body').css('height',leftheight+240);
});
</script>